3.38 \(\int (a+b \csc (c+d x))^2 \, dx\)

Optimal. Leaf size=34 \[ a^2 x-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{b^2 \cot (c+d x)}{d} \]

[Out]

a^2*x - (2*a*b*ArcTanh[Cos[c + d*x]])/d - (b^2*Cot[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.025757, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3773, 3770, 3767, 8} \[ a^2 x-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{b^2 \cot (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Csc[c + d*x])^2,x]

[Out]

a^2*x - (2*a*b*ArcTanh[Cos[c + d*x]])/d - (b^2*Cot[c + d*x])/d

Rule 3773

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + (Dist[2*a*b, Int[Csc[c + d*x], x],
 x] + Dist[b^2, Int[Csc[c + d*x]^2, x], x]) /; FreeQ[{a, b, c, d}, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int (a+b \csc (c+d x))^2 \, dx &=a^2 x+(2 a b) \int \csc (c+d x) \, dx+b^2 \int \csc ^2(c+d x) \, dx\\ &=a^2 x-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{b^2 \operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=a^2 x-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{b^2 \cot (c+d x)}{d}\\ \end{align*}

Mathematica [B]  time = 0.181533, size = 76, normalized size = 2.24 \[ \frac{2 a \left (a c+a d x+2 b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-2 b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )\right )+b^2 \tan \left (\frac{1}{2} (c+d x)\right )+b^2 \left (-\cot \left (\frac{1}{2} (c+d x)\right )\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Csc[c + d*x])^2,x]

[Out]

(-(b^2*Cot[(c + d*x)/2]) + 2*a*(a*c + a*d*x - 2*b*Log[Cos[(c + d*x)/2]] + 2*b*Log[Sin[(c + d*x)/2]]) + b^2*Tan
[(c + d*x)/2])/(2*d)

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 52, normalized size = 1.5 \begin{align*}{a}^{2}x-{\frac{{b}^{2}\cot \left ( dx+c \right ) }{d}}+2\,{\frac{ab\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}c}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*csc(d*x+c))^2,x)

[Out]

a^2*x-b^2*cot(d*x+c)/d+2/d*a*b*ln(csc(d*x+c)-cot(d*x+c))+1/d*a^2*c

________________________________________________________________________________________

Maxima [A]  time = 0.996058, size = 58, normalized size = 1.71 \begin{align*} a^{2} x - \frac{2 \, a b \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} - \frac{b^{2}}{d \tan \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c))^2,x, algorithm="maxima")

[Out]

a^2*x - 2*a*b*log(cot(d*x + c) + csc(d*x + c))/d - b^2/(d*tan(d*x + c))

________________________________________________________________________________________

Fricas [B]  time = 0.503685, size = 209, normalized size = 6.15 \begin{align*} \frac{a^{2} d x \sin \left (d x + c\right ) - a b \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) + a b \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - b^{2} \cos \left (d x + c\right )}{d \sin \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c))^2,x, algorithm="fricas")

[Out]

(a^2*d*x*sin(d*x + c) - a*b*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + a*b*log(-1/2*cos(d*x + c) + 1/2)*sin(d*
x + c) - b^2*cos(d*x + c))/(d*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \csc{\left (c + d x \right )}\right )^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c))**2,x)

[Out]

Integral((a + b*csc(c + d*x))**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.42798, size = 100, normalized size = 2.94 \begin{align*} \frac{2 \,{\left (d x + c\right )} a^{2} + 4 \, a b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{4 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(2*(d*x + c)*a^2 + 4*a*b*log(abs(tan(1/2*d*x + 1/2*c))) + b^2*tan(1/2*d*x + 1/2*c) - (4*a*b*tan(1/2*d*x +
1/2*c) + b^2)/tan(1/2*d*x + 1/2*c))/d